<?php defined('_JEXEC') or die('Restricted access');

jimport('joomla.session.session');

//load tables
JTable::addIncludePath(JPATH_COMPONENT.'/tables');

//load classes
JLoader::registerPrefix('Productmanager', JPATH_COMPONENT);

//and now load the plugins...
JPluginHelper::importPlugin('productmanager');

//need an app...
$app = JFactory::getApplication();

//Get some specific controller (if needed)
if ($controller = $app->input->get('controller','default')) {
	require_once(JPATH_COMPONENT.'/controllers/'.$controller.'.php');
}

//Create controller
$classname = 'ProductmanagerController'.$controller;
$controller = new $classname();

//Let's perform the request
$controller->execute();